home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include <stdlib.h>
- #include "CTMain.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
- TMainForm *MainForm;
- //---------------------------------------------------------------------------
- __fastcall TMainForm::TMainForm(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TMainForm::FormCreate(TObject *Sender)
- {
- char colors[][10] =
- {"Gray", "Blue", "Pink", "Orange", "Mauve"};
- char critters[][10] =
- {"Monkeys", "Pigs", "Dogs", "Bears", "Tapirs"};
- // fill the listbox with random strings
- randomize();
- char buff[100];
- for (int i=0;i<50;i++) {
- wsprintf(buff, "Critter: %s %s",
- colors[random(5)], critters[random(5)]);
- DropDown->Items->Add(buff);
- wsprintf(buff, "Critter: %s %s",
- colors[random(5)], critters[random(5)]);
- DropDownList->Items->Add(buff);
- wsprintf(buff, "Critter: %s %s",
- colors[random(5)], critters[random(5)]);
- Simple->Items->Add(buff);
- }
- }
- //---------------------------------------------------------------------